package com.example.lishuai.activityanimationdemo;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.transition.Explode;
import android.transition.Fade;
import android.transition.Slide;
import android.view.KeyEvent;

/**
 * Created by lishuai on 2017/2/10.
 */
public class FenJieActivity extends AppCompatActivity{
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_fenjie);
        //获取传值
        Bundle bundle = getIntent().getExtras();
        String key = bundle.getString("key");
        if(key.equals("one")){
            //分解
            getWindow().setEnterTransition(new Explode().setDuration(200));
            getWindow().setExitTransition(new Explode().setDuration(200));
        }else if(key.equals("two")){
            //滑动进入
            getWindow().setEnterTransition(new Slide().setDuration(200));
            getWindow().setExitTransition(new Slide().setDuration(200));
        }else if(key.equals("three")){
            //淡入淡出
            getWindow().setEnterTransition(new Fade().setDuration(200));
            getWindow().setExitTransition(new Fade().setDuration(200));
        }
    }
}
